Add target ASMABAK (STM32F446RET6 custom flight controller)#11540
Add target ASMABAK (STM32F446RET6 custom flight controller)#11540Petrograd1 wants to merge 2 commits intoiNavFlight:maintenance-9.xfrom
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
Review Summary by QodoAdd ASMABAK flight controller target (STM32F446RET6)
WalkthroughsDescription• Add new flight controller target ASMABAK based on STM32F446RET6 • Configure MPU9255 IMU, BMP280 barometer, MAX7456 OSD on SPI/I2C • Define 4x DShot motor outputs on TIM3 and gimbal servo outputs • Configure 5 UARTs for receiver, GPS, MSP, VTX, and telemetry Diagramflowchart LR
STM32F446["STM32F446RET6<br/>HSE 8MHz"] --> IMU["MPU9255 IMU<br/>SPI1"]
STM32F446 --> BARO["BMP280 Barometer<br/>I2C1"]
STM32F446 --> OSD["MAX7456 OSD<br/>SPI2"]
STM32F446 --> MOTORS["4x DShot Motors<br/>TIM3"]
STM32F446 --> SERVOS["4x Gimbal Servos<br/>TIM1/TIM2"]
STM32F446 --> UART["5x UARTs<br/>RX/GPS/MSP/VTX"]
STM32F446 --> IO["LED/Buzzer<br/>GPIO"]
File Changes1. src/main/target/ASMABAK/target.h
|
Code Review by Qodo
1.
|
| @@ -0,0 +1 @@ | |||
| target_stm32f405xg(ASMABAK HSE_MHZ 8) No newline at end of file | |||
There was a problem hiding this comment.
2. Wrong mcu build target 🐞 Bug ≡ Correctness
ASMABAK is built with target_stm32f405xg(), which hardcodes STM32F405xx compile definitions, MCU_FLASH_SIZE=1024, and the stm32_flash_f405xg linker script. If the actual board MCU differs (per PR description: STM32F446), this produces a binary compiled/linked for the wrong device/flash layout and can fail to boot or overflow flash expectations.
Agent Prompt
### Issue description
`ASMABAK` is built with `target_stm32f405xg(...)`, which sets `STM32F405xx`, `MCU_FLASH_SIZE=1024`, and uses the `stm32_flash_f405xg` linker script. For an STM32F446-based board this is the wrong MCU configuration and can generate an invalid binary.
### Issue Context
The MCU selection is centralized in `cmake/stm32f4.cmake`. `ASMABAK` currently reuses the F405 macro.
### Fix Focus Areas
- src/main/target/ASMABAK/CMakeLists.txt[1-1]
- cmake/stm32f4.cmake[103-140]
### What to change
- Add a new CMake function for STM32F446 (e.g. `target_stm32f446xe(...)` or similar) that:
- Defines the correct MCU macro (e.g. `STM32F446xx`) and correct `MCU_FLASH_SIZE` for the intended part.
- Uses an appropriate startup file and linker script for F446.
- Uses the correct SVD (`STM32F446` exists under `dev/svd`).
- Update `ASMABAK/CMakeLists.txt` to call the new STM32F446 function instead of `target_stm32f405xg(...)`.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Hello. Are you a representative of the manufacturer? |
Add target ASMABAK (STM32F446RET6)
Adds support for custom flight controller AsMaBak based on STM32F446RET6.
Hardware features:
Build command: